From 9e8fd772d0dd8d711b0c2cc9e187f4a72553c21b Mon Sep 17 00:00:00 2001 From: Keir Fraser Date: Thu, 23 Apr 2009 12:21:29 +0100 Subject: [PATCH] x86 numa: Fix left shift overflows Signed-off-by: Yang Xiaowei --- xen/arch/x86/numa.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/xen/arch/x86/numa.c b/xen/arch/x86/numa.c index 8ed3a11494..8ef96b4732 100644 --- a/xen/arch/x86/numa.c +++ b/xen/arch/x86/numa.c @@ -74,7 +74,7 @@ populate_memnodemap(const struct node *nodes, int numnodes, int shift) if (memnodemap[addr >> shift] != 0xff) return -1; memnodemap[addr >> shift] = i; - addr += (1UL << shift); + addr += (1ULL << shift); } while (addr < end); res = 1; } @@ -290,7 +290,7 @@ static void dump_numa(unsigned char key) (u32)(now>>32), (u32)now); for_each_online_node(i) { - paddr_t pa = (NODE_DATA(i)->node_start_pfn + 1)<< PAGE_SHIFT; + paddr_t pa = (paddr_t)(NODE_DATA(i)->node_start_pfn + 1)<< PAGE_SHIFT; printk("idx%d -> NODE%d start->%lu size->%lu\n", i, NODE_DATA(i)->node_id, NODE_DATA(i)->node_start_pfn, @@ -314,7 +314,7 @@ static void dump_numa(unsigned char key) page_list_for_each(page, &d->page_list) { - i = phys_to_nid(page_to_mfn(page) << PAGE_SHIFT); + i = phys_to_nid((paddr_t)page_to_mfn(page) << PAGE_SHIFT); page_num_node[i]++; } -- 2.30.2